package org.ufinity.hsms.module.device;

import org.ufinity.hsms.common.utils.SystemUtils;
import org.ufinity.hsms.module.TabGroupActivity;
import org.ufinity.hsms.module.busy.BusyActivity;

import android.app.ActivityGroup;
import android.content.Intent;
import android.os.Bundle;
import android.view.KeyEvent;
import android.view.View;
import android.view.Window;

public class DeviceStackActivity extends TabGroupActivity{  
    String id = "DevicesActivity";
   @Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		
		startChildActivity("DevicesActivity", new Intent(getParent(),
				//DevicesActivity.class));
				HistoryActivity.class));
	}	
	
   @Override
	public boolean dispatchKeyEvent(KeyEvent event) {
	   if(event.getAction()==KeyEvent.ACTION_DOWN){
			int length = mIdList.size();
			if (length > 0) {
				if(mIdList.get(length - 1).equals(id)){
					SystemUtils.openOptionsDialog(getParent());
				}
			}
		}
		return super.dispatchKeyEvent(event);
	}
    
}
